package tests;
import javax.swing.JFrame;

import customer.GUI.components.wizard.NetPlayCustomWizard;
import customer.GUI.components.wizard.NetPlayCustomWizardPanelDesc;

public class WizardTest {

	public static void main(String [] args)
	{
		JFrame myFrame = new JFrame("Test Wizard");
		myFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
		NetPlayCustomWizard wizard = new NetPlayCustomWizard(myFrame);
        wizard.getDialog().setTitle("Test Wizard Dialog");
        
        
        NetPlayCustomWizardPanelDesc descriptor1 = new TestPanel1Descriptor();
        wizard.registerWizardPanel(TestPanel1Descriptor.IDENTIFIER, descriptor1);

        NetPlayCustomWizardPanelDesc descriptor2 = new TestPanel2Descriptor();
        wizard.registerWizardPanel(TestPanel2Descriptor.IDENTIFIER, descriptor2);

        NetPlayCustomWizardPanelDesc descriptor3 = new TestPanel3Descriptor();
        wizard.registerWizardPanel(TestPanel3Descriptor.IDENTIFIER, descriptor3);
        
        wizard.setCurrentPanel(TestPanel1Descriptor.IDENTIFIER);
        
        int ret = wizard.showModalDialog();
        
        System.out.println("Dialog return code is (0=Finish,1=Cancel,2=Error): " + ret);
        System.out.println("Second panel selection is: " + 
            (((TestPanel2)descriptor2.getPanelComponent()).getRadioButtonSelected()));
        
        System.exit(0);
        
	}
}
